package com.share.tool.generator.api.postman.model;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class ApiBody {
    @ApiModelProperty("模式---固定值")
    private String mode = "raw";
    @ApiModelProperty("json字符串")
    private String raw;
    @ApiModelProperty("请求提配置---固定值")
    private String options = initRaw();

    String initRaw() {
        JSONObject objRaw = new JSONObject();
        JSONObject objLanguage = new JSONObject();
        objRaw.put("raw", objLanguage);
        objLanguage.put("language", "json");
        return JSON.toJSONString(objRaw);
    }
}
